import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

const state = {
  // 面包屑
  breadcrumb: {},
  // 返回路径
  back: {},
  // 控制显示和使用动态路由数据,非固定
  breadcrumb2: {
    isShow: false,
    list: []
  }
}

const mutations = {
  // 赋值面包屑
  changeBreadcrumb: (state, value) => {
    state.breadcrumb = value;
  },
  // 赋值返回按钮
  changeBack: (state, value) => {
    state.back = value;
  },
  // 赋值面包屑2
  changeBreadcrumb2: (state, value) => {
    state.breadcrumb2 = value;
  }
}

const store = new Vuex.Store({
  // ...
  state,
  mutations
})

export default store;
